# Setting-up
install.packages("manifestoR")                                        ### this is the Manifesto R package
library(manifestoR)
load("data_ipod.RData") 

# Load CMP data
mp_setapikey("C:/Users/gschuma1/Downloads/manifesto_apikey.txt")      
cmp_data <- mp_maindataset()
cmp_data$month_election <- as.numeric(substr(cmp_data$date,5,6))
cmp_data$year <- substr(cmp_data$date,1,4)
cmp_data$cmp <- cmp_data$party
cmp_data <- cmp_data[,c(22:78,165,170:172)]                           ### omit this if you want to have all cmp variables

data_ipod <- join(data_ipod, cmp_data, by=c("cmp","year", "month_election"))